package com.study.java.classloader;

/**
* @Name: ClassLoaderTest01
* @Description: 类加载器测试01
* 类加载全过程：加载->链接(验证、准备、解析)->初始化(执行类构造器<clinit>()方法)
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-2-9 下午2:10:55 
* @Version: V1.0
 */
public class ClassLoaderTest01 {
	
	static {
		System.out.println("静态初始化类ClassLoaderTest01");
	}
	
	public static void main(String[] args) {
		System.out.println("调用类ClassLoaderTest01的main方法");
		A a1 = new A() ;
		System.out.println(a1.width);
	}
	

}

class A extends A_father {
	public static int width = 100 ;
	static {
		System.out.println(width);
		System.out.println("静态初始化类A");
		width = 300 ;
	}
	public A() {
		System.out.println("创建A类的对象");
	}
}

class A_father {
	static {
		System.out.println("静态初始化类A_father");
	}
}










